import { createRouter, createWebHashHistory, createWebHistory, createMemoryHistory } from "vue-router"


//1.声明routers配置,一个routes是一个数组,routes对象里面的基本属性由path和component组成


let routes = [
    
    {
        path: "/login",
        component: () => import(/*webpackChunkName*/"../pages/login/index.vue"),
        name: "login",
        meta: {
            name: '登入页'
        }
    },
    {
        path: "/",
        component: () => import(/*webpackChunkName*/"../pages/home/index.vue"),
        name: "home",
        children:[
            {
                path:'attendance',
                component:() => import("../pages/home/attendance/index.vue")
            },
            {
                path:'welcome',
                component:() => import("../pages/home/welcome/index.vue")
            },
        ]
    },

]

//2.创建路由
const router = createRouter({
    history: createWebHashHistory("/base"),
    routes
})


//3.导出路由
export default router